﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;
using System.Web.Mvc;

namespace TrilhaImovel.UI.Controllers
{
    public class RouteRegistrar
    {
        public static void RegisterRoutesTo(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });

            routes.MapRoute(
                "EstateDetail",                                   
                "Estate/{action}/{estateId}",
                new { controller = "Estate", action = "ViewDetail", estateId = 0 } 
            );

            routes.MapRoute(
                "Default",                                              // Route name
                "{controller}/{action}/{latitude}/{longitude}",                           // URL with parameters
                new { controller = "Home", action = "Index", latitude = UrlParameter.Optional, longitude = UrlParameter.Optional }  // Parameter defaults
            );
        }
    }
}
